package com.gem.web;

import com.gem.entity.Student;
import com.gem.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

/**
 * @author 刘聪
 * Created  on 2020/10/14
 */
@Controller
@RequestMapping("/permission")
@SessionAttributes("student")
public class StudentController {
    @Autowired
    private StudentService studentService;

    @GetMapping("/index")
    public String index() {
        return "list";
    }

    @PostMapping("/edit")
    public String edit(Student student) {
        studentService.editStudents(student);
        return "list";
    }
}
